﻿<%@ Page Title="Schedule" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ActivityScheduleEdit.aspx.cs" Inherits="Vision.Web.Pages.ActivityScheduleEdit" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ContentPlaceHolderID="HeadContent" runat="server">
    <script language="javascript" type="text/javascript">
        var tblWeeklySection;
        var tblMonthlySection;
        var ddlScheduleTypes;

        //onLoad()
        function onLoad() {            
            tblWeeklySection = document.getElementById("tblWeekly");
            tblMonthlySection = document.getElementById("tblMonthly");
            ddlScheduleTypes = document.getElementById("<%=ddlScheduleTypes.ClientID%>");            
            
            ddlScheduleTypes_onChange();
        }

        //ddlScheduleTypes_onChange
        function ddlScheduleTypes_onChange() {
            tblWeeklySection.style.display = "none";
            tblMonthlySection.style.display = "none";
            
            switch (ddlScheduleTypes.value) {
                case "Weekly":
                    tblWeeklySection.style.display = "";
                    break;
                case "Monthly":
                    tblMonthlySection.style.display = "";
                    break;
            }
        }

        window.onload = onLoad;
    </script>
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" runat="server">        
    <asp:LinkButton Text="<< Back" Font-Size="8" ID="btnBack" runat="server" onclick="btnBack_Click"/>
    <h2>Schedule</h2>
    <div>
        <span>
            <asp:Label Text="Activity:" Width="65" runat="server" Font-Size="8"/>
            <asp:Label ID="lblActivtyName" runat="server" Font-Size="8"/>
        </span>
    </div>        
    <div>
        <span>
            <asp:Label Text="Description:" Width="65" runat="server" Font-Size="8"/>
            <asp:Label ID="lblActivtyDesc" runat="server" Font-Size="8"/>
        </span>
    </div>    
    <br />
    <div>
        <table>
            <tr valign="middle">
                <td><asp:Label Text="Type:" Font-Size="8" runat="server" /></td>
                <td><asp:DropDownList ID="ddlScheduleTypes" Font-Size="8" runat="server" onchange="ddlScheduleTypes_onChange();"/></td>
            </tr>
            <tr valign="middle">
                <td><asp:Label Text="Description:" Font-Size="8" runat="server"/></td>
                <td><asp:TextBox ID="txtDescription" Font-Size="8" runat="server" TextMode="MultiLine" Height="50" Width="200"/></td>
            </tr>
            <tr valign="middle">
                <td><asp:Label Text="Activity Key:" Font-Size="8" runat="server" /></td>
                <td><asp:Label ID="lblActivityKey" Font-Size="8" runat="server" /></td>
            </tr>
            <tr>
                <td>                    
                    <asp:Label Text="" Width="16" runat="server" />
                    <asp:Label Text="Active:" Font-Size="8" runat="server" />
                </td>
                <td>
                    <asp:CheckBox ID="chkActive" Font-Size="8" runat="server"/>    
                </td>
            </tr>            
            <tr valign="middle">
                <td>
                    <asp:Label Text="" Width="16" runat="server" />
                    <asp:Label Text="Start:" Font-Size="8" runat="server" />
                </td>  
                <td>
                    <asp:TextBox ID="txtStartDate" Width="60" Font-Size="8" runat="server"/>
                    <asp:TextBox ID="txtStartTime" Width="60" Font-Size="8" runat="server"/>
                    <asp:CalendarExtender TargetControlID="txtStartDate" runat="server" />
                    <asp:MaskedEditExtender ID="MaskedEditExtender1" TargetControlID="txtStartTime" Mask="99:99:99" MaskType="Time" runat="server" />                                                        
                </td>                
            </tr>
            <tr valign="middle">
                <td>
                    <asp:CheckBox ID="chkExpire" Text="Expire:" Font-Size="8" runat="server"/>                    
                </td>  
                <td>
                    <asp:TextBox ID="txtEndDate" Width="60" Font-Size="8" runat="server"/>                    
                    <asp:TextBox ID="txtEndTime" Width="60" Font-Size="8" runat="server"/>
                    <asp:CalendarExtender TargetControlID="txtEndDate" runat="server" />
                    <asp:MaskedEditExtender ID="MaskedEditExtender2" TargetControlID="txtEndTime" Mask="99:99:99" MaskType="Time" runat="server" />                                                                                            
                </td>                
            </tr>
            <tr valign="middle">
                <td>                    
                    <asp:Label Text="" Width="16" runat="server" />
                    <asp:Label Text="Repeat:" Font-Size="8" runat="server" />
                </td>  
                <td>                    
                    <asp:TextBox ID="txtRepeatTime" Width="60" Font-Size="8" runat="server"/>  
                    <asp:MaskedEditExtender ID="MaskedEditExtender3" TargetControlID="txtRepeatTime" Mask="99:99:99" MaskType="Time" runat="server" />                                                                                              
                </td>                
            </tr>            
        </table>        
        <table id="tblWeekly" style="border:1px solid black;display:none">            
            <tr>                
                <td>
                    <asp:CheckBoxList ID="cblWeekDays" RepeatColumns="4" RepeatLayout="Table" RepeatDirection="Horizontal" Font-Size="8" runat="server" />
                </td>
            </tr>
        </table>
        <table id="tblMonthly" style="border:1px solid black;display:none">            
            <tr>                
                <td colspan="2">
                    <asp:CheckBoxList ID="cblMonths" RepeatColumns="6" RepeatLayout="Table" RepeatDirection="Horizontal" Font-Size="8" runat="server" />
                </td>
            </tr>
            <tr>
                <td><asp:Label Text="Date:" Font-Size="8" runat="server" /></td>
                <td>
                    <asp:TextBox ID="txtMonthDate" Width="60" Font-Size="8" runat="server"/>                                       
                </td>
            </tr>
        </table>
    </div>
    <hr />
    <div>
        <asp:Button ID="btnSave" Text="Save" Width="100" Font-Size="8" runat="server" onclick="btnSave_Click" />
    </div>    
</asp:Content>